Transcranial magnetic stimulation (TMS) is a noninvasive method of focally stimulating the brain that uses electromagnetic induction and does not require surgery. There is optimism that TMS will revolutionize how we treat neurological and psychiatric disorders, evidenced by over 1000 clinical trials registered using TMS. Much of this optimism stems from the successful use of TMS as a treatment for depression. Despite the large number of clinical trials using TMS the number of therapeutic indications has been stagnant, limited to major depression and more recently obsessive-compulsive disorder. There are fundamental questions about the underlying mechanisms of action for TMS that will be critical to understand in order to advance this treatment modality. Here, we propose a unique collaborative project between neurology and neurosurgery that will allow an unprecedented window into understanding how TMS impacts the human brain. Specifically, we will perform TMS in neurosurgical patients with intracranial electroencephalography (iEEG) monitoring to record real time effects of TMS on local and remote brain areas with an unparalleled combination of spatial and temporal resolution relative to other human studies. We have already demonstrated the safety of this approach using a gel-based phantom brain and have results from seven patients demonstrating safety and preliminary results. For the current proposal we aim to: 1) characterize the response of TMS on the human brain as recorded from iEEG between active and sham conditions, and 2) relate remote electrophysiological responses induced by TMS to measures of brain connectivity between the stimulation and recording sites assessed with resting state functional connectivity MRI (rs-fcMRI). This will allow us to evaluate the relationship between TMS-evoked iEEG responses and the strength of functional connectivity to the stimulation site in a regression model. We hypothesize that: 1) TMS will have focal effects detected from surface electrodes underlying the stimulation site as well as network-level engagement detected at remote sites, 2) Repetitive TMS will induce frequency- specific effects that differ between 0.5 and 10 Hz stimulation protocols, and 3) the magnitude of repetitive TMS-evoked iEEG responses across electrodes will relate to the strength of rs-fcMRI between the stimulation and recording sites. By investigating the electrophysiological responses of TMS with high spatiotemporal precision in humans, this study will provide new mechanistic insights into the effects of TMS on target engagement and relate these findings to imaging methods already in widespread use. Moreover, the TMS will be applied in a clinically meaningful way by targeting the left dorsolateral prefrontal cortex in a protocol used to treat depression. Generating results for these aims will be key to advancing our understanding of how TMS engages brain networks, which can be leveraged to rationally develop personalized, imaging-guided therapeutic TMS for depression and other disorders.